package com.example.wst.zyftpt_332wst.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;

import com.example.wst.zyftpt_332wst.R;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    private TextView tv_login, tv_register;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main1);
        init();
    }

    private void init() {
        tv_login = (TextView) findViewById(R.id.TextView_Login);
        tv_register = (TextView) findViewById(R.id.TextView_Register);
        tv_login.setOnClickListener(this);
        tv_register.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.TextView_Login:
                //当前activity
                Intent intent = new Intent(MainActivity.this,LoginActivity.class);
                startActivity(intent);
                break;
            case R.id.TextView_Register:
                //当前activity
                Intent intent2 = new Intent(MainActivity.this,RegisterActivity.class);
                startActivity(intent2);
                break;
        }

    }
}
